﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NeuralNetwork
{
    public class OutputPerceptron : PerceptronBase
    {
        public double Error { get; set; }
        
        public override void CalculateOutput(double[] weights, NeuralLayerBase previousLayer)
        {
            double output = 0.0f;
            int size = weights.GetLength(0);

            for (int i = 0; i < size; ++i)
            {
                output += weights[i] * previousLayer.Perceptrons[i].Output;
            }

            Output = output;
        }
    }
}
